package com.dynamixsoftware.printershare.smb;

import com.dynamixsoftware.printershare.smb.netbios.Name;
import com.dynamixsoftware.printershare.smb.netbios.NbtAddress;
import com.dynamixsoftware.printershare.smb.netbios.NbtException;
import com.dynamixsoftware.printershare.smb.netbios.SessionRequestPacket;
import com.dynamixsoftware.printershare.smb.netbios.SessionServicePacket;
import com.dynamixsoftware.printershare.smb.util.Encdec;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.ConnectException;
import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.net.NoRouteToHostException;
import java.net.Socket;
import java.util.LinkedList;
import java.util.ListIterator;

class SmbTransport
  extends Transport
  implements SmbConstants
{
  private static final byte[] BUF = new byte[65535];
  private static final SmbComNegotiate NEGOTIATE_REQUEST = new SmbComNegotiate();
  private UniAddress address;
  int capabilities = 4180;
  SigningDigest digest = null;
  int flags2 = 51203;
  private InputStream in;
  private SmbComBlankResponse key = new SmbComBlankResponse();
  private InetAddress localAddr;
  private int localPort;
  int maxMpxCount = 10;
  private int mid;
  private OutputStream out;
  private int port;
  int rcv_buf_size = 60416;
  private byte[] sbuf = new byte[512];
  ServerData server = new ServerData();
  private long sessionExpiration = 15000L + System.currentTimeMillis();
  int sessionKey = 0;
  private LinkedList sessions = new LinkedList();
  int snd_buf_size = 16644;
  private Socket socket;
  String tconHostName = null;
  private boolean useUnicode = true;
  
  private SmbTransport(UniAddress paramUniAddress, int paramInt1, InetAddress paramInetAddress, int paramInt2)
  {
    this.address = paramUniAddress;
    this.port = paramInt1;
    this.localAddr = paramInetAddress;
    this.localPort = paramInt2;
  }
  
  private void checkStatus(ServerMessageBlock paramServerMessageBlock1, ServerMessageBlock paramServerMessageBlock2)
    throws SmbException
  {
    paramServerMessageBlock2.errorCode = SmbException.getStatusByCode(paramServerMessageBlock2.errorCode);
    switch (paramServerMessageBlock2.errorCode)
    {
    default: 
      throw new SmbException(paramServerMessageBlock2.errorCode, null);
    case -1073741790: 
    case -1073741718: 
    case -1073741715: 
    case -1073741714: 
    case -1073741713: 
    case -1073741712: 
    case -1073741711: 
    case -1073741710: 
    case -1073741428: 
    case -1073741260: 
      throw new SmbAuthException(paramServerMessageBlock2.errorCode);
    case -1073741225: 
      if (paramServerMessageBlock1.auth == null) {
        throw new SmbException(paramServerMessageBlock2.errorCode, null);
      }
      throw new SmbException(paramServerMessageBlock2.errorCode, null);
    }
    if (paramServerMessageBlock2.verifyFailed) {
      throw new SmbException("Signature verification failed.");
    }
  }
  
  private void doSend0(Request paramRequest)
    throws IOException
  {
    try
    {
      doSend(paramRequest);
      return;
    }
    catch (IOException localIOException1) {}
    try
    {
      disconnect(true);
      label12:
      throw localIOException1;
    }
    catch (IOException localIOException2)
    {
      break label12;
    }
  }
  
  static SmbTransport getSmbTransport(UniAddress paramUniAddress, int paramInt)
  {
    try
    {
      SmbTransport localSmbTransport = getSmbTransport(paramUniAddress, paramInt, LADDR, 0, null);
      return localSmbTransport;
    }
    finally
    {
      localObject = finally;
      throw localObject;
    }
  }
  
  /* Error */
  static SmbTransport getSmbTransport(UniAddress paramUniAddress, int paramInt1, InetAddress paramInetAddress, int paramInt2, String paramString)
  {
    // Byte code:
    //   0: ldc 2
    //   2: monitorenter
    //   3: getstatic 171	com/dynamixsoftware/printershare/smb/SmbTransport:CONNECTIONS	Ljava/util/LinkedList;
    //   6: astore 6
    //   8: aload 6
    //   10: monitorenter
    //   11: getstatic 171	com/dynamixsoftware/printershare/smb/SmbTransport:CONNECTIONS	Ljava/util/LinkedList;
    //   14: invokevirtual 175	java/util/LinkedList:listIterator	()Ljava/util/ListIterator;
    //   17: astore 8
    //   19: aload 8
    //   21: invokeinterface 181 1 0
    //   26: ifeq +56 -> 82
    //   29: aload 8
    //   31: invokeinterface 185 1 0
    //   36: checkcast 2	com/dynamixsoftware/printershare/smb/SmbTransport
    //   39: astore 11
    //   41: aload 11
    //   43: aload_0
    //   44: iload_1
    //   45: aload_2
    //   46: iload_3
    //   47: aload 4
    //   49: invokespecial 189	com/dynamixsoftware/printershare/smb/SmbTransport:matches	(Lcom/dynamixsoftware/printershare/smb/UniAddress;ILjava/net/InetAddress;ILjava/lang/String;)Z
    //   52: ifeq -33 -> 19
    //   55: aload 11
    //   57: getfield 83	com/dynamixsoftware/printershare/smb/SmbTransport:sessions	Ljava/util/LinkedList;
    //   60: invokevirtual 193	java/util/LinkedList:size	()I
    //   63: sipush 250
    //   66: if_icmpge -47 -> 19
    //   69: aload 6
    //   71: monitorexit
    //   72: aload 11
    //   74: astore 10
    //   76: ldc 2
    //   78: monitorexit
    //   79: aload 10
    //   81: areturn
    //   82: new 2	com/dynamixsoftware/printershare/smb/SmbTransport
    //   85: dup
    //   86: aload_0
    //   87: iload_1
    //   88: aload_2
    //   89: iload_3
    //   90: invokespecial 195	com/dynamixsoftware/printershare/smb/SmbTransport:<init>	(Lcom/dynamixsoftware/printershare/smb/UniAddress;ILjava/net/InetAddress;I)V
    //   93: astore 9
    //   95: getstatic 171	com/dynamixsoftware/printershare/smb/SmbTransport:CONNECTIONS	Ljava/util/LinkedList;
    //   98: iconst_0
    //   99: aload 9
    //   101: invokevirtual 199	java/util/LinkedList:add	(ILjava/lang/Object;)V
    //   104: aload 6
    //   106: monitorexit
    //   107: aload 9
    //   109: astore 10
    //   111: goto -35 -> 76
    //   114: astore 7
    //   116: aload 6
    //   118: monitorexit
    //   119: aload 7
    //   121: athrow
    //   122: astore 5
    //   124: ldc 2
    //   126: monitorexit
    //   127: aload 5
    //   129: athrow
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	130	0	paramUniAddress	UniAddress
    //   0	130	1	paramInt1	int
    //   0	130	2	paramInetAddress	InetAddress
    //   0	130	3	paramInt2	int
    //   0	130	4	paramString	String
    //   122	6	5	localObject1	Object
    //   114	6	7	localObject2	Object
    //   17	13	8	localListIterator	ListIterator
    //   93	15	9	localSmbTransport1	SmbTransport
    //   74	36	10	localObject3	Object
    //   39	34	11	localSmbTransport2	SmbTransport
    // Exception table:
    //   from	to	target	type
    //   11	19	114	finally
    //   19	72	114	finally
    //   82	107	114	finally
    //   116	119	114	finally
    //   3	11	122	finally
    //   119	122	122	finally
  }
  
  private boolean matches(UniAddress paramUniAddress, int paramInt1, InetAddress paramInetAddress, int paramInt2, String paramString)
  {
    if (paramString == null) {
      paramString = paramUniAddress.getHostName();
    }
    return ((this.tconHostName == null) || (paramString.equalsIgnoreCase(this.tconHostName))) && (paramUniAddress.equals(this.address)) && ((paramInt1 == 0) || (paramInt1 == this.port) || ((paramInt1 == 445) && (this.port == 139))) && ((paramInetAddress == this.localAddr) || ((paramInetAddress != null) && (paramInetAddress.equals(this.localAddr)))) && (paramInt2 == this.localPort);
  }
  
  private void negotiate(int paramInt, ServerMessageBlock paramServerMessageBlock)
    throws IOException
  {
    byte[] arrayOfByte = this.sbuf;
    if (paramInt == 139) {}
    for (;;)
    {
      try
      {
        ssn139();
        int i = 1 + this.mid;
        this.mid = i;
        if (i == 32000) {
          this.mid = 1;
        }
        NEGOTIATE_REQUEST.mid = this.mid;
        int j = NEGOTIATE_REQUEST.encode(this.sbuf, 4);
        Encdec.enc_uint32be(j & 0xFFFF, this.sbuf, 0);
        this.out.write(this.sbuf, 0, j + 4);
        this.out.flush();
        if (peekKey() != null) {
          break;
        }
        throw new IOException("transport closed in negotiate");
      }
      finally {}
      if (paramInt == 0) {
        paramInt = 445;
      }
      this.socket = new Socket();
      if (this.localAddr != null) {
        this.socket.bind(new InetSocketAddress(this.localAddr, this.localPort));
      }
      this.socket.connect(new InetSocketAddress(this.address.getHostAddress(), paramInt), 15000);
      this.out = this.socket.getOutputStream();
      this.in = this.socket.getInputStream();
    }
    int k = 0xFFFF & Encdec.dec_uint16be(this.sbuf, 2);
    if ((k < 33) || (k + 4 > this.sbuf.length)) {
      throw new IOException("Invalid payload size: " + k);
    }
    readn(this.in, this.sbuf, 36, k - 32);
    paramServerMessageBlock.decode(this.sbuf, 4);
  }
  
  private void ssn139()
    throws IOException
  {
    Name localName = new Name(this.address.firstCalledName(), 32, null);
    for (;;)
    {
      this.socket = new Socket();
      if (this.localAddr != null) {
        this.socket.bind(new InetSocketAddress(this.localAddr, this.localPort));
      }
      this.socket.connect(new InetSocketAddress(this.address.getHostAddress(), 139), 15000);
      this.out = this.socket.getOutputStream();
      this.in = this.socket.getInputStream();
      SessionRequestPacket localSessionRequestPacket = new SessionRequestPacket(localName, NbtAddress.getLocalName());
      this.out.write(this.sbuf, 0, localSessionRequestPacket.writeWireFormat(this.sbuf, 0));
      if (readn(this.in, this.sbuf, 0, 4) < 4) {}
      try
      {
        this.socket.close();
        label164:
        throw new SmbException("EOF during NetBIOS session request");
        switch (0xFF & this.sbuf[0])
        {
        default: 
          disconnect(true);
          throw new NbtException(2, 0);
        case 131: 
          int i = 0xFF & this.in.read();
          switch (i)
          {
          case 129: 
          default: 
            disconnect(true);
            throw new NbtException(2, i);
          }
          this.socket.close();
          String str = this.address.nextCalledName();
          localName.name = str;
          if (str != null) {
            continue;
          }
          throw new IOException("Failed to establish session with " + this.address);
        case -1: 
          disconnect(true);
          throw new NbtException(2, -1);
        }
      }
      catch (IOException localIOException)
      {
        break label164;
      }
    }
  }
  
  void connect()
    throws SmbException
  {
    try
    {
      super.connect(15000L);
      return;
    }
    catch (TransportException localTransportException)
    {
      throw new SmbException("Failed to connect: " + this.address, localTransportException);
    }
  }
  
  protected void doConnect()
    throws IOException
  {
    int i = 445;
    SmbComNegotiateResponse localSmbComNegotiateResponse = new SmbComNegotiateResponse(this.server);
    try
    {
      negotiate(this.port, localSmbComNegotiateResponse);
      if (localSmbComNegotiateResponse.dialectIndex > 10) {
        throw new SmbException("This client does not support the negotiated dialect.");
      }
    }
    catch (ConnectException localConnectException)
    {
      for (;;)
      {
        if ((this.port == 0) || (this.port == i)) {
          i = 139;
        }
        this.port = i;
        negotiate(this.port, localSmbComNegotiateResponse);
      }
    }
    catch (NoRouteToHostException localNoRouteToHostException)
    {
      for (;;)
      {
        if ((this.port == 0) || (this.port == i)) {
          i = 139;
        }
        this.port = i;
        negotiate(this.port, localSmbComNegotiateResponse);
      }
      this.tconHostName = this.address.getHostName();
      if (this.server.signaturesRequired) {
        break label284;
      }
    }
    if (this.server.signaturesEnabled) {}
    label284:
    for (this.flags2 = (0xFFFB & this.flags2);; this.flags2 = (0x4 | this.flags2))
    {
      this.maxMpxCount = Math.min(this.maxMpxCount, this.server.maxMpxCount);
      if (this.maxMpxCount < 1) {
        this.maxMpxCount = 1;
      }
      this.snd_buf_size = Math.min(this.snd_buf_size, this.server.maxBufferSize);
      this.capabilities &= this.server.capabilities;
      if ((0x80000000 & this.server.capabilities) == -2147483648) {
        this.capabilities = (0x80000000 | this.capabilities);
      }
      if ((0x4 & this.capabilities) == 0)
      {
        this.useUnicode = false;
        this.flags2 = (0x7FFF & this.flags2);
      }
      return;
    }
  }
  
  protected void doDisconnect(boolean paramBoolean)
    throws IOException
  {
    ListIterator localListIterator = this.sessions.listIterator();
    try
    {
      while (localListIterator.hasNext()) {
        ((SmbSession)localListIterator.next()).logoff(paramBoolean);
      }
      this.socket.shutdownOutput();
    }
    finally
    {
      this.digest = null;
      this.socket = null;
      this.tconHostName = null;
    }
    this.out.close();
    this.in.close();
    this.socket.close();
    this.digest = null;
    this.socket = null;
    this.tconHostName = null;
  }
  
  protected void doRecv(Response paramResponse)
    throws IOException
  {
    ServerMessageBlock localServerMessageBlock = (ServerMessageBlock)paramResponse;
    localServerMessageBlock.useUnicode = this.useUnicode;
    int i = 0x80000000 & this.capabilities;
    boolean bool = false;
    if (i == -2147483648) {
      bool = true;
    }
    localServerMessageBlock.extendedSecurity = bool;
    int j;
    synchronized (BUF)
    {
      System.arraycopy(this.sbuf, 0, BUF, 0, 36);
      j = 0xFFFF & Encdec.dec_uint16be(BUF, 2);
      if ((j < 33) || (j + 4 > this.rcv_buf_size)) {
        throw new IOException("Invalid payload size: " + j);
      }
    }
    int k = 0xFFFFFFFF & Encdec.dec_uint32le(BUF, 9);
    if ((localServerMessageBlock.command == 46) && ((k == 0) || (k == -2147483643)))
    {
      SmbComReadAndXResponse localSmbComReadAndXResponse = (SmbComReadAndXResponse)localServerMessageBlock;
      readn(this.in, BUF, 36, 27);
      (32 + 27);
      localServerMessageBlock.decode(BUF, 4);
      int m = -59 + localSmbComReadAndXResponse.dataOffset;
      if ((localSmbComReadAndXResponse.byteCount > 0) && (m > 0) && (m < 4)) {
        readn(this.in, BUF, 63, m);
      }
      if (localSmbComReadAndXResponse.dataLength > 0) {
        readn(this.in, localSmbComReadAndXResponse.b, localSmbComReadAndXResponse.off, localSmbComReadAndXResponse.dataLength);
      }
    }
    for (;;)
    {
      if ((this.digest != null) && (localServerMessageBlock.errorCode == 0)) {
        this.digest.verify(BUF, 4, localServerMessageBlock);
      }
      return;
      readn(this.in, BUF, 36, j - 32);
      localServerMessageBlock.decode(BUF, 4);
      if ((localServerMessageBlock instanceof SmbComTransactionResponse)) {
        ((SmbComTransactionResponse)localServerMessageBlock).nextElement();
      }
    }
  }
  
  protected void doSend(Request paramRequest)
    throws IOException
  {
    synchronized (BUF)
    {
      int i = ((ServerMessageBlock)paramRequest).encode(BUF, 4);
      Encdec.enc_uint32be(0xFFFF & i, BUF, 0);
      this.out.write(BUF, 0, i + 4);
      return;
    }
  }
  
  protected void doSkip()
    throws IOException
  {
    int i = 0xFFFF & Encdec.dec_uint16be(this.sbuf, 2);
    if ((i < 33) || (i + 4 > this.rcv_buf_size))
    {
      this.in.skip(this.in.available());
      return;
    }
    this.in.skip(i - 32);
  }
  
  SmbSession getSmbSession(NtlmPasswordAuthentication paramNtlmPasswordAuthentication)
  {
    for (;;)
    {
      try
      {
        ListIterator localListIterator1 = this.sessions.listIterator();
        if (localListIterator1.hasNext())
        {
          SmbSession localSmbSession3 = (SmbSession)localListIterator1.next();
          if (!localSmbSession3.matches(paramNtlmPasswordAuthentication)) {
            continue;
          }
          localSmbSession3.auth = paramNtlmPasswordAuthentication;
          localObject2 = localSmbSession3;
          return localObject2;
        }
        long l1 = this.sessionExpiration;
        long l2 = System.currentTimeMillis();
        if (l1 < l2)
        {
          this.sessionExpiration = (15000L + l2);
          ListIterator localListIterator2 = this.sessions.listIterator();
          if (localListIterator2.hasNext())
          {
            SmbSession localSmbSession2 = (SmbSession)localListIterator2.next();
            if (localSmbSession2.expiration >= l2) {
              continue;
            }
            localSmbSession2.logoff(false);
            continue;
          }
        }
        localSmbSession1 = new SmbSession(this.address, this.port, this.localAddr, this.localPort, paramNtlmPasswordAuthentication);
      }
      finally {}
      SmbSession localSmbSession1;
      localSmbSession1.transport = this;
      this.sessions.add(localSmbSession1);
      Object localObject2 = localSmbSession1;
    }
  }
  
  boolean hasCapability(int paramInt)
    throws SmbException
  {
    try
    {
      connect(15000L);
      if ((paramInt & this.capabilities) == paramInt) {
        return true;
      }
    }
    catch (IOException localIOException)
    {
      throw new SmbException(localIOException.getMessage(), localIOException);
    }
    return false;
  }
  
  boolean isSignatureSetupRequired(NtlmPasswordAuthentication paramNtlmPasswordAuthentication)
  {
    return ((0x4 & this.flags2) != 0) && (this.digest == null) && (paramNtlmPasswordAuthentication != NtlmPasswordAuthentication.ANONYMOUS) && (!NtlmPasswordAuthentication.ANONYMOUS.equals(paramNtlmPasswordAuthentication));
  }
  
  protected void makeKey(Request paramRequest)
    throws IOException
  {
    int i = 1 + this.mid;
    this.mid = i;
    if (i == 32000) {
      this.mid = 1;
    }
    ((ServerMessageBlock)paramRequest).mid = this.mid;
  }
  
  protected Request peekKey()
    throws IOException
  {
    if (readn(this.in, this.sbuf, 0, 4) < 4) {}
    do
    {
      return null;
      if (this.sbuf[0] == -123) {
        break;
      }
    } while (readn(this.in, this.sbuf, 4, 32) < 32);
    for (;;)
    {
      if ((this.sbuf[0] == 0) && (this.sbuf[1] == 0) && (this.sbuf[4] == -1) && (this.sbuf[5] == 83) && (this.sbuf[6] == 77) && (this.sbuf[7] == 66))
      {
        this.key.mid = (0xFFFF & Encdec.dec_uint16le(this.sbuf, 34));
        return this.key;
      }
      for (int i = 0; i < 35; i++) {
        this.sbuf[i] = this.sbuf[(i + 1)];
      }
      int j = this.in.read();
      if (j == -1) {
        break;
      }
      this.sbuf[35] = ((byte)j);
    }
  }
  
  /* Error */
  void send(ServerMessageBlock paramServerMessageBlock1, ServerMessageBlock paramServerMessageBlock2)
    throws SmbException
  {
    // Byte code:
    //   0: aload_0
    //   1: invokevirtual 518	com/dynamixsoftware/printershare/smb/SmbTransport:connect	()V
    //   4: aload_1
    //   5: aload_1
    //   6: getfield 519	com/dynamixsoftware/printershare/smb/ServerMessageBlock:flags2	I
    //   9: aload_0
    //   10: getfield 93	com/dynamixsoftware/printershare/smb/SmbTransport:flags2	I
    //   13: ior
    //   14: putfield 519	com/dynamixsoftware/printershare/smb/ServerMessageBlock:flags2	I
    //   17: aload_1
    //   18: aload_0
    //   19: getfield 106	com/dynamixsoftware/printershare/smb/SmbTransport:useUnicode	Z
    //   22: putfield 424	com/dynamixsoftware/printershare/smb/ServerMessageBlock:useUnicode	Z
    //   25: aload_1
    //   26: aload_2
    //   27: putfield 523	com/dynamixsoftware/printershare/smb/ServerMessageBlock:response	Lcom/dynamixsoftware/printershare/smb/ServerMessageBlock;
    //   30: aload_1
    //   31: getfield 524	com/dynamixsoftware/printershare/smb/ServerMessageBlock:digest	Lcom/dynamixsoftware/printershare/smb/SigningDigest;
    //   34: ifnonnull +11 -> 45
    //   37: aload_1
    //   38: aload_0
    //   39: getfield 78	com/dynamixsoftware/printershare/smb/SmbTransport:digest	Lcom/dynamixsoftware/printershare/smb/SigningDigest;
    //   42: putfield 524	com/dynamixsoftware/printershare/smb/ServerMessageBlock:digest	Lcom/dynamixsoftware/printershare/smb/SigningDigest;
    //   45: aload_2
    //   46: ifnonnull +9 -> 55
    //   49: aload_0
    //   50: aload_1
    //   51: invokespecial 526	com/dynamixsoftware/printershare/smb/SmbTransport:doSend0	(Lcom/dynamixsoftware/printershare/smb/Request;)V
    //   54: return
    //   55: aload_1
    //   56: instanceof 528
    //   59: ifeq +347 -> 406
    //   62: aload_2
    //   63: aload_1
    //   64: getfield 438	com/dynamixsoftware/printershare/smb/ServerMessageBlock:command	B
    //   67: putfield 438	com/dynamixsoftware/printershare/smb/ServerMessageBlock:command	B
    //   70: aload_1
    //   71: checkcast 528	com/dynamixsoftware/printershare/smb/SmbComTransaction
    //   74: astore 5
    //   76: aload_2
    //   77: checkcast 464	com/dynamixsoftware/printershare/smb/SmbComTransactionResponse
    //   80: astore 6
    //   82: aload 5
    //   84: aload_0
    //   85: getfield 97	com/dynamixsoftware/printershare/smb/SmbTransport:snd_buf_size	I
    //   88: putfield 529	com/dynamixsoftware/printershare/smb/SmbComTransaction:maxBufferSize	I
    //   91: aload 6
    //   93: invokevirtual 532	com/dynamixsoftware/printershare/smb/SmbComTransactionResponse:reset	()V
    //   96: aload 5
    //   98: aload 6
    //   100: invokestatic 538	com/dynamixsoftware/printershare/smb/BufferCache:getBuffers	(Lcom/dynamixsoftware/printershare/smb/SmbComTransaction;Lcom/dynamixsoftware/printershare/smb/SmbComTransactionResponse;)V
    //   103: aload 5
    //   105: invokevirtual 539	com/dynamixsoftware/printershare/smb/SmbComTransaction:nextElement	()Ljava/lang/Object;
    //   108: pop
    //   109: aload 5
    //   111: invokevirtual 542	com/dynamixsoftware/printershare/smb/SmbComTransaction:hasMoreElements	()Z
    //   114: ifeq +233 -> 347
    //   117: new 63	com/dynamixsoftware/printershare/smb/SmbComBlankResponse
    //   120: dup
    //   121: invokespecial 64	com/dynamixsoftware/printershare/smb/SmbComBlankResponse:<init>	()V
    //   124: astore 9
    //   126: aload_0
    //   127: aload 5
    //   129: aload 9
    //   131: ldc2_w 67
    //   134: invokespecial 546	com/dynamixsoftware/printershare/smb/Transport:sendrecv	(Lcom/dynamixsoftware/printershare/smb/Request;Lcom/dynamixsoftware/printershare/smb/Response;J)V
    //   137: aload 9
    //   139: getfield 547	com/dynamixsoftware/printershare/smb/SmbComBlankResponse:errorCode	I
    //   142: ifeq +11 -> 153
    //   145: aload_0
    //   146: aload 5
    //   148: aload 9
    //   150: invokespecial 549	com/dynamixsoftware/printershare/smb/SmbTransport:checkStatus	(Lcom/dynamixsoftware/printershare/smb/ServerMessageBlock;Lcom/dynamixsoftware/printershare/smb/ServerMessageBlock;)V
    //   153: aload 5
    //   155: invokevirtual 539	com/dynamixsoftware/printershare/smb/SmbComTransaction:nextElement	()Ljava/lang/Object;
    //   158: pop
    //   159: aload_0
    //   160: monitorenter
    //   161: aload_2
    //   162: iconst_0
    //   163: putfield 552	com/dynamixsoftware/printershare/smb/ServerMessageBlock:received	Z
    //   166: aload 6
    //   168: iconst_0
    //   169: putfield 555	com/dynamixsoftware/printershare/smb/SmbComTransactionResponse:isReceived	Z
    //   172: aload_0
    //   173: getfield 559	com/dynamixsoftware/printershare/smb/SmbTransport:response_map	Ljava/util/HashMap;
    //   176: aload 5
    //   178: aload 6
    //   180: invokevirtual 565	java/util/HashMap:put	(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
    //   183: pop
    //   184: aload_0
    //   185: aload 5
    //   187: invokespecial 526	com/dynamixsoftware/printershare/smb/SmbTransport:doSend0	(Lcom/dynamixsoftware/printershare/smb/Request;)V
    //   190: aload 5
    //   192: invokevirtual 542	com/dynamixsoftware/printershare/smb/SmbComTransaction:hasMoreElements	()Z
    //   195: ifeq +11 -> 206
    //   198: aload 5
    //   200: invokevirtual 539	com/dynamixsoftware/printershare/smb/SmbComTransaction:nextElement	()Ljava/lang/Object;
    //   203: ifnonnull -19 -> 184
    //   206: ldc2_w 67
    //   209: lstore 16
    //   211: aload 6
    //   213: lload 16
    //   215: invokestatic 74	java/lang/System:currentTimeMillis	()J
    //   218: ladd
    //   219: putfield 566	com/dynamixsoftware/printershare/smb/SmbComTransactionResponse:expiration	J
    //   222: aload 6
    //   224: invokevirtual 567	com/dynamixsoftware/printershare/smb/SmbComTransactionResponse:hasMoreElements	()Z
    //   227: ifeq +129 -> 356
    //   230: aload_0
    //   231: lload 16
    //   233: invokevirtual 572	java/lang/Object:wait	(J)V
    //   236: aload 6
    //   238: getfield 566	com/dynamixsoftware/printershare/smb/SmbComTransactionResponse:expiration	J
    //   241: invokestatic 74	java/lang/System:currentTimeMillis	()J
    //   244: lsub
    //   245: lstore 16
    //   247: lload 16
    //   249: lconst_0
    //   250: lcmp
    //   251: ifgt -29 -> 222
    //   254: new 366	com/dynamixsoftware/printershare/smb/TransportException
    //   257: dup
    //   258: new 294	java/lang/StringBuilder
    //   261: dup
    //   262: invokespecial 295	java/lang/StringBuilder:<init>	()V
    //   265: aload_0
    //   266: invokevirtual 364	java/lang/StringBuilder:append	(Ljava/lang/Object;)Ljava/lang/StringBuilder;
    //   269: ldc_w 574
    //   272: invokevirtual 301	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   275: aload 5
    //   277: invokevirtual 364	java/lang/StringBuilder:append	(Ljava/lang/Object;)Ljava/lang/StringBuilder;
    //   280: invokevirtual 307	java/lang/StringBuilder:toString	()Ljava/lang/String;
    //   283: invokespecial 575	com/dynamixsoftware/printershare/smb/TransportException:<init>	(Ljava/lang/String;)V
    //   286: athrow
    //   287: astore 14
    //   289: new 366	com/dynamixsoftware/printershare/smb/TransportException
    //   292: dup
    //   293: aload 14
    //   295: invokespecial 578	com/dynamixsoftware/printershare/smb/TransportException:<init>	(Ljava/lang/Throwable;)V
    //   298: athrow
    //   299: astore 12
    //   301: aload_0
    //   302: getfield 559	com/dynamixsoftware/printershare/smb/SmbTransport:response_map	Ljava/util/HashMap;
    //   305: aload 5
    //   307: invokevirtual 582	java/util/HashMap:remove	(Ljava/lang/Object;)Ljava/lang/Object;
    //   310: pop
    //   311: aload 12
    //   313: athrow
    //   314: astore 11
    //   316: aload_0
    //   317: monitorexit
    //   318: aload 11
    //   320: athrow
    //   321: astore 7
    //   323: aload 5
    //   325: getfield 585	com/dynamixsoftware/printershare/smb/SmbComTransaction:txn_buf	[B
    //   328: invokestatic 589	com/dynamixsoftware/printershare/smb/BufferCache:releaseBuffer	([B)V
    //   331: aload 6
    //   333: getfield 590	com/dynamixsoftware/printershare/smb/SmbComTransactionResponse:txn_buf	[B
    //   336: invokestatic 589	com/dynamixsoftware/printershare/smb/BufferCache:releaseBuffer	([B)V
    //   339: aload 7
    //   341: athrow
    //   342: astore 4
    //   344: aload 4
    //   346: athrow
    //   347: aload_0
    //   348: aload 5
    //   350: invokevirtual 592	com/dynamixsoftware/printershare/smb/SmbTransport:makeKey	(Lcom/dynamixsoftware/printershare/smb/Request;)V
    //   353: goto -194 -> 159
    //   356: aload_2
    //   357: getfield 125	com/dynamixsoftware/printershare/smb/ServerMessageBlock:errorCode	I
    //   360: ifeq +11 -> 371
    //   363: aload_0
    //   364: aload 5
    //   366: aload 6
    //   368: invokespecial 549	com/dynamixsoftware/printershare/smb/SmbTransport:checkStatus	(Lcom/dynamixsoftware/printershare/smb/ServerMessageBlock;Lcom/dynamixsoftware/printershare/smb/ServerMessageBlock;)V
    //   371: aload_0
    //   372: getfield 559	com/dynamixsoftware/printershare/smb/SmbTransport:response_map	Ljava/util/HashMap;
    //   375: aload 5
    //   377: invokevirtual 582	java/util/HashMap:remove	(Ljava/lang/Object;)Ljava/lang/Object;
    //   380: pop
    //   381: aload_0
    //   382: monitorexit
    //   383: aload 5
    //   385: getfield 585	com/dynamixsoftware/printershare/smb/SmbComTransaction:txn_buf	[B
    //   388: invokestatic 589	com/dynamixsoftware/printershare/smb/BufferCache:releaseBuffer	([B)V
    //   391: aload 6
    //   393: getfield 590	com/dynamixsoftware/printershare/smb/SmbComTransactionResponse:txn_buf	[B
    //   396: invokestatic 589	com/dynamixsoftware/printershare/smb/BufferCache:releaseBuffer	([B)V
    //   399: aload_0
    //   400: aload_1
    //   401: aload_2
    //   402: invokespecial 549	com/dynamixsoftware/printershare/smb/SmbTransport:checkStatus	(Lcom/dynamixsoftware/printershare/smb/ServerMessageBlock;Lcom/dynamixsoftware/printershare/smb/ServerMessageBlock;)V
    //   405: return
    //   406: aload_2
    //   407: aload_1
    //   408: getfield 438	com/dynamixsoftware/printershare/smb/ServerMessageBlock:command	B
    //   411: putfield 438	com/dynamixsoftware/printershare/smb/ServerMessageBlock:command	B
    //   414: aload_0
    //   415: aload_1
    //   416: aload_2
    //   417: ldc2_w 67
    //   420: invokespecial 546	com/dynamixsoftware/printershare/smb/Transport:sendrecv	(Lcom/dynamixsoftware/printershare/smb/Request;Lcom/dynamixsoftware/printershare/smb/Response;J)V
    //   423: goto -24 -> 399
    //   426: astore_3
    //   427: new 120	com/dynamixsoftware/printershare/smb/SmbException
    //   430: dup
    //   431: aload_3
    //   432: invokevirtual 500	java/io/IOException:getMessage	()Ljava/lang/String;
    //   435: aload_3
    //   436: invokespecial 374	com/dynamixsoftware/printershare/smb/SmbException:<init>	(Ljava/lang/String;Ljava/lang/Throwable;)V
    //   439: athrow
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	440	0	this	SmbTransport
    //   0	440	1	paramServerMessageBlock1	ServerMessageBlock
    //   0	440	2	paramServerMessageBlock2	ServerMessageBlock
    //   426	10	3	localIOException	IOException
    //   342	3	4	localSmbException	SmbException
    //   74	310	5	localSmbComTransaction	SmbComTransaction
    //   80	312	6	localSmbComTransactionResponse	SmbComTransactionResponse
    //   321	19	7	localObject1	Object
    //   124	25	9	localSmbComBlankResponse	SmbComBlankResponse
    //   314	5	11	localObject2	Object
    //   299	13	12	localObject3	Object
    //   287	7	14	localInterruptedException	java.lang.InterruptedException
    //   209	39	16	l	long
    // Exception table:
    //   from	to	target	type
    //   172	184	287	java/lang/InterruptedException
    //   184	206	287	java/lang/InterruptedException
    //   211	222	287	java/lang/InterruptedException
    //   222	247	287	java/lang/InterruptedException
    //   254	287	287	java/lang/InterruptedException
    //   356	371	287	java/lang/InterruptedException
    //   172	184	299	finally
    //   184	206	299	finally
    //   211	222	299	finally
    //   222	247	299	finally
    //   254	287	299	finally
    //   289	299	299	finally
    //   356	371	299	finally
    //   161	172	314	finally
    //   301	314	314	finally
    //   316	318	314	finally
    //   371	383	314	finally
    //   96	153	321	finally
    //   153	159	321	finally
    //   159	161	321	finally
    //   318	321	321	finally
    //   347	353	321	finally
    //   49	54	342	com/dynamixsoftware/printershare/smb/SmbException
    //   55	96	342	com/dynamixsoftware/printershare/smb/SmbException
    //   323	342	342	com/dynamixsoftware/printershare/smb/SmbException
    //   383	399	342	com/dynamixsoftware/printershare/smb/SmbException
    //   406	423	342	com/dynamixsoftware/printershare/smb/SmbException
    //   49	54	426	java/io/IOException
    //   55	96	426	java/io/IOException
    //   323	342	426	java/io/IOException
    //   383	399	426	java/io/IOException
    //   406	423	426	java/io/IOException
  }
  
  public String toString()
  {
    return super.toString() + "[" + this.address + ":" + this.port + "]";
  }
  
  class ServerData
  {
    int capabilities;
    boolean encryptedPasswords;
    byte[] encryptionKey;
    int encryptionKeyLength;
    byte[] guid;
    int maxBufferSize;
    int maxMpxCount;
    int maxNumberVcs;
    int maxRawSize;
    String oemDomainName;
    int security;
    int securityMode;
    long serverTime;
    int serverTimeZone;
    int sessionKey;
    boolean signaturesEnabled;
    boolean signaturesRequired;
    
    ServerData() {}
  }
}


/* Location:           C:\Users\Admin\Desktop\Decompiler\JAD\jd-gui-0.3.6.windows\classes_dex2jar.jar
 * Qualified Name:     com.dynamixsoftware.printershare.smb.SmbTransport
 * JD-Core Version:    0.7.0.1
 */